export default {
    namespaced: true,
    state: {
        // userInfo: JSON.parse(sessionStorage.getItem('USER')) || {},
        userInfo: {
            isLogin: false,
            token: 'nskajgksmegf1541512sefawfbaiwbkjsneqw3e3',
            access: ['superAdmin'],
        },
    },
    mutations: {
        updateUser(state, value) {
            if (value !== undefined && value !== null) {
                state.userInfo = value;
                sessionStorage.setItem('USER', JSON.stringify(value));
            } else {
                state.userInfo = {};
                sessionStorage.removeItem('USER');
            }
        },
    },
    getters: {
        userInfo: (state, getters, rootState) => state.userInfo,
    },
    actions: {},
};
